package com.tom.usercenter.common;

import lombok.Data;

/**
 * 统一结果返回
 */
@Data
public  class BaseResponse<T> {
    /**
     * 自定义泛型
     * 返回数据
     */
    private T data;
    /**
     * 返回状态码
     *
     */
    private int code;
    /**
     * 返回信息
     */
    private String message;
    public BaseResponse(int code, String msg, T data) {
        this.code = code;
        this.message = msg;
        this.data = data;
    }
    public BaseResponse(int code, String msg) {
        this.code = code;
        this.message = msg;
    }

    public BaseResponse(ResultCodeEnum resultCodeEnum, T data) {
        this(resultCodeEnum.getCode(), resultCodeEnum.getMessage(), data);
    }


}
